import 'dart:async';

import 'package:lib_core/lib_core.dart';
import 'package:lib_ui/bridge/dialog_bridge.dart';
import 'package:lib_ui/lib_ui.dart';

class DialogBridgeImpl extends DialogFlutterApi {
  @override
  Future<String?> showFlutterInputDialog(String title, String content, String hint) async {
    final result = await BoostNavigator.instance.push(
      UiRoutes.inputDialog,
      arguments: {'title': title, 'content': content, 'hint': hint},
      withContainer: true,
      opaque: false,
    );
    return (result as Map<String, dynamic>?)?['string'] ?? '';
  }

  @override
  Future<bool?> showFlutterNormalDialog(String title, String content) async {
    final result = await BoostNavigator.instance.push(
      UiRoutes.msgDialog,
      arguments: {'title': title, 'content': content},
      withContainer: true,
      opaque: false,
    );
    return (result as Map<String, dynamic>?)?['confirm'] ?? false;
  }
}
